# -*- coding: UTF-8 -*-
import os
import signal
import sys

from lj_tool import tool_try

__exit_funs = []


def isWindow():
    return os.name == 'nt'


def isLinux():
    return os.name == 'posix'

# 仅支持 linux


def sysInfo():
    return os.uname()


def exit_listen(fun):
    __exit_funs.append(fun)


def __lj_exit():
    for fun in __exit_funs:
        try:
            fun()
        except:
            print("LJ - 模块退出异常...")


signal.signal(signal.SIGINT, lambda sig, frame: __lj_exit())

# 命令行直接运行该文件时才会触发该判定
if __name__ == '__main__':
    print('命令行参数 %s' % sys.argv)
